package com.yx.changdao.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yx.changdao.common.entity.CommunityBuildDetail;
import com.yx.changdao.common.exception.AlertException;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;


/**
 * @Description: <br/>
 * 户信息表
 * <p>
 * <br/>
 * @Auther: flexible
 * @create 2020/04/02 13:47
 */
public interface CommunityBuildDetailService extends IService<CommunityBuildDetail> {

    /**
     * 根据建筑id查有那几户
     */
   List<CommunityBuildDetail> getBuidDetailByBuildId(Integer buildId);
  /*  *//**
     * 根据单元，室查出具体用户
     *//*
    CommunityBuildDetail getUserByUnit(Integer unit,String houseNumber);*/

    /**
     * 删除户
     */
    @Transactional(rollbackFor = {Exception.class})
    boolean removeResident(Integer id);

    /**
     * 根据楼id，室id，单元，查室
     * buildId:楼id
     * doorPlate：门牌号
     * unit：单元
     */
    CommunityBuildDetail getOneByBuildIdAndUnit(String buildId,String doorPlate,Integer unit);

    /**
     * 批量导入户
     */
    Map<String,Object> checkAndSave(MultipartFile communityBuildDetail) throws AlertException;
}
